<template>
  <!-- 底部部分 -->
  <section>
    <footer class="footer">
      <span class="todo-count"
        ><strong>{{ sum }}</strong
        >剩余</span
      >
      <ul class="filters">
        <li>
          <a
            :class="{ selected: type === 'all' }"
            href="#/"
            @click="comporType('all')"
            >全部</a
          >
        </li>
        <li>
          <a
            :class="{ selected: type === 'active' }"
            href="#/active"
            @click="comporType('active')"
            >进行中</a
          >
        </li>
        <li>
          <a
            :class="{ selected: type === 'completed' }"
            href="#/completed"
            @click="comporType('completed')"
            >已完成</a
          >
        </li>
      </ul>
      <button class="clear-completed" v-if="isShow" @click="clearQchu">
        清除已完成
      </button>
    </footer>
  </section>
</template>

<script>
export default {
  name: 'TodoWeibu',
  components: {},
  props: {
    sum: {
      type: Number, //转数字
      require: true,
    },
    isShow: {
      tyoe: Boolean, //布尔型
      require: true,
    },
    type: {
      type: String, //转字符串
      require: true,
    },
  },
  data() {
    return {}
  },
  methods: {
    clearQchu() {
      this.$emit('clearQchu')
    },
    comporType(name) {
      this.$emit('comporType', name)
    },
  },
}
</script>

<style scoped></style>
